<template>
  <div>
    <el-container style=" border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1']" router>
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-message"></i>账号
            </template>
            <el-menu-item-group>
              <el-menu-item index="/account_adm">管理员账户</el-menu-item>
              <el-menu-item index="/account_user">普通用户账户</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-message"></i>文章
            </template>
            <el-menu-item-group>
              <el-menu-item index="/tool_b">工具</el-menu-item>
              <el-menu-item index="/article_b">文章</el-menu-item>
              <el-menu-item index="/sensitive">敏感词设置</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-message"></i>轮播图
            </template>
            <el-menu-item-group>
              <el-menu-item index="/image">图片设置</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-message"></i>心情
            </template>
            <el-menu-item-group>
              <el-menu-item index="/mood_b">心情</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <span>{{username}}</span>
        </el-header>

        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: ""
    };
  },
  methods: {
    getusername() {
      //得到前端传来的值
      this.username = JSON.parse(this.$route.query.data);
    }
  },
  created() {
    this.getusername();
  }
};
</script>

<style scoped>
el-header {
  background-color: #b3c0d1;
  color: #333;
  line-height: 60px;
}
</style>
